#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<vector>

using namespace std;

class Solution {
public:
    vector<vector<int>> generate(int numRows) {
        vector < vector<int>> result;

        for (int row = 0; row < numRows; row++)
        {
            vector<int> currentRow(row + 1, 1);

            for (int col = 1; col < row; col++)
            {
                currentRow[col] = result[row - 1][col - 1] + result[row - 1][col];
            }

            result.push_back(currentRow);
        }

        return result;
    }
};

int main()
{
    Solution solution;
    int numRows;
    cin >> numRows;

    vector<vector<int>> result = solution.generate(numRows);

    for (const auto& row : result)
    {
        for (int num : row)
        {
            cout << num << " ";
        }

        cout << endl;
    }
	return 0;
}